﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace awaittest
{
    class Program
    {
        static void Main(string[] args)
        {
            Async7();
            Console.WriteLine("Main " + Thread.CurrentThread.ManagedThreadId);
            Console.ReadKey();
            Async7();
            Console.ReadKey();
        }
        static async void Async7()
        {
            Console.WriteLine("Async7 start" + Thread.CurrentThread.ManagedThreadId);
            await Task.Run(() =>
            {
                Thread.Sleep(2000);
                Console.WriteLine("await"+Thread.CurrentThread.ManagedThreadId);
            });
            Console.WriteLine("Async7 end "+Thread.CurrentThread.ManagedThreadId);
        }
    }
}
